package io.github.talelin.sleeve.controller.v1;

import io.github.talelin.sleeve.entity.SpecKey;
import io.github.talelin.sleeve.service.SpuService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 复杂的增删改查 多表操作
 */
@RestController
@RequestMapping("v1/Spu_spec")
@Validated
public class SpuSpecController {

    @Resource
    private SpuService spuService;

    @GetMapping("/spuId/{id}")
    public List<SpecKey> getBySpuId(@PathVariable Long id){
        spuService.getSpecBySpuId(id);
        return spuService.getSpecBySpuId(id);
    }
}
